package com.leo.foodmaster.admin.foodMaterial.mapper;

import com.leo.foodmaster.admin.foodMaterial.entity.FoodMaterialType;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.leo.foodmaster.admin.system.entity.SysDictData;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author Leo
 * @since 2021-07-14
 */
public interface FoodMaterialTypeMapper extends BaseMapper<FoodMaterialType> {

    /**
     * 查询所有食材类型列表，转换为字典数据列表
     * @return List<SysDictData>
     */
    @Select("SELECT id, `name`, id AS dictValue, 'food_material_type' AS dictType " +
            "FROM food_material_type ")
    List<SysDictData> listFoodMaterialTypeAsDict();
}
